<?php
/**
 * ------------------------------------------------------------------------
 * JA Disqus Debate Echo plugin for Joomla 2.5
 * ------------------------------------------------------------------------
 * Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * ------------------------------------------------------------------------
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

//Disqus config
$subdomain      = $this->plgParams->get('provider-disqus-subdomain');
$devmode        = $this->plgParams->get('provider-disqus-devmode',0);

$devcode = "";
if ($devmode)
	$devcode = "var disqus_developer = \"1\";";

?>
<script type='text/javascript'>
//<![CDATA[
<?php echo $devcode; ?>
var disqus_shortname = '<?php echo $subdomain; ?>';
window.addEvent('load', function(){
	(function () {
	  var s = document.createElement('script'); s.async = true;
	  s.src = 'http://disqus.com/forums/<?php echo $subdomain; ?>/count.js?v=<?php echo time(); ?>';
	  (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(s);
	}());
});
//]]>
</script>